package com.zfh.rr;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/getParam")
public class GetParamServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 接请求
		request.setCharacterEncoding("utf-8");
		String name = request.getParameter("username");
		String email = request.getParameter("email");
		String[] starnames = request.getParameterValues("starname");
		
		// 做业务
		request.setAttribute("name", name);
		request.setAttribute("email", email);
		request.setAttribute("star", starnames);
		
		request.getRequestDispatcher("/servlet/showChoose.jsp").forward(request, response);
		
	}

}
